﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using UsersProvider;

namespace WebGuiMvc.Models
{
   public class ProfileModel
   {
      private User innerProfile;

      public ProfileModel(User innerProfile)
      {
         if (innerProfile == null) throw new ArgumentNullException("innerProfile");
         this.innerProfile = innerProfile;
      }

      public string Username
      {
         get
         {
            return innerProfile.Login;
         }
         set
         {
            innerProfile.Login = value;
         }
      }

      public string Language
      {
         get
         {
            return innerProfile.PreferredLanguage;
         }
         set
         {
            innerProfile.PreferredLanguage = value;
         }
      }

      public static implicit operator User(ProfileModel model)
      {
         return model.innerProfile;
      }

      public TimeZone TimeZone { get; set; }

      public IEnumerable<string> OpenIds
      {
         get
         {
            return new List<string> { "1", "2", "3" };
         }
      }
   }
}